home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / fsp-2.7 / fsp-2 / fsp / clients / fver.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-21  |  2.3 KB  |  63 lines

  1.     /*********************************************************************\
  2.     *  Copyright (c) 1991 by Wen-King Su (wen-king@vlsi.cs.caltech.edu)   *
  3.     *                                                                     *
  4.     *  You may copy or modify this file in any manner you wish, provided  *
  5.     *  that this notice is always included, and that you hold the author  *
  6.     *  harmless for any loss or damage resulting from the installation or *
  7.     *  use of this software.                                              *
  8.     \*********************************************************************/
  9.  
  10. #include "tweak.h"
  11. #include "client_def.h"
  12. #include "c_extern.h"
  13. #include "version.h"
  14. #include <stdio.h>
  15.  
  16. int main PROTO3(int, argc, char **, argv, char **, envp)
  17. {
  18.   UBUF *ub;
  19.   unsigned int len, tput = 0, len2;
  20.   char *v1, *v2;
  21.   
  22.   if(argc == 1)    { /* no arg supplied, get version string of server */
  23.     env_client();
  24.     ub = client_interact(CC_VERSION,0L, 0, (unsigned char *)NULLP, 0,
  25.              (unsigned char *)NULLP);
  26.     len = BB_READ2(ub->bb_len);
  27.     len2 = BB_READ4(ub->bb_pos);
  28.     v1 = ub->buf; v2 = ub->buf+len;
  29.     printf("FSP version: %s\n",v1);
  30.     /* we have a new type of server */
  31.     if(len2) {
  32.       if(*v2 & VER_LOG)
  33.     printf("\tLogging of all server transactions is ENABLED.\n");
  34.       else
  35.     printf("\tLogging of all server transactions is DISABLED.\n");
  36.       if(*v2 & VER_READONLY)
  37.     printf("\tRemote server is run in READONLY mode.\n");
  38.       else
  39.     printf("\tRemote server is run in READ/WRITE mode.\n");
  40.       if(*v2 & VER_REVNAME)
  41.     printf("\tServer REQUIRES connections to reverse name.\n");
  42.       else
  43.     printf("\tServer DOESN'T REQUIRE connections to reverse.\n");
  44.       if(*v2 & VER_PRIVMODE)
  45.     printf("\tRemote server is run in PRIVATE mode.\n");
  46.       else
  47.     printf("\tRemote server is run in PUBLIC mode.\n");
  48.       if(*v2 & VER_THRUPUT) {
  49.     printf("\tRemote server throughput control is ENABLED.");
  50.     tput |= (((unsigned)*(++v2) << 24) & 0xff000000);
  51.     tput |= (((unsigned)*(++v2) << 16) & 0x00ff0000);
  52.     tput |= (((unsigned)*(++v2) << 8) & 0x0000ff00);
  53.     tput |= ((unsigned)*(++v2) & 0x000000ff);
  54.     printf(" (max %d bytes/sec)\n", tput);
  55.       } else
  56.     printf("\tRemote server throughput control is DISABLED.\n");
  57.     }
  58.     client_done();
  59.   } else
  60.     printf("Local FSP version: %s\n",VERSION_STR);
  61.   exit(0);
  62. }
  63.